# def common_assert(r,success,code,message):
#     assert success==r.json().get("success")
#     assert code ==r.json().get("code")
#     assert message in  r.json().get("message")
from api.irhm_add_api import IRHMAddApi


def common_assert(r,status_code,success,code,msg):
    assert status_code == r.status_code
    assert r.json().get('success') is success
    assert code == r.json().get('code')
    assert msg in r.json().get('message')

if __name__ == '__main__':
    json = {
        "username": "大头",
        "mobile": "17740652422",
        "workNumber": "9527"
    }
    r = IRHMAddApi.add(json)
    common_assert(r,200,True,10000,'操作成功')